package com.kk.builder;

/**
 * 建造者模式
 *
 * @author 王志强
 * @date 2021-12-14
 */

public class Client {
    public static void main(String[] args) {
        //普通房子
        CommonBuilder commonBuilder = new CommonBuilder();
        HouseDirector houseDirector = new HouseDirector(commonBuilder);
        houseDirector.constructHouse();
        System.out.println("CommonBuilder house.getBasic = " + commonBuilder.house.getBasic());

        System.out.println();

        //高楼
        HightBuilder hightBuilder = new HightBuilder();
        houseDirector.setHouseBuilder(hightBuilder);
        houseDirector.constructHouse();
        System.out.println("HightBuilder house.getBasic = " + hightBuilder.house.getBasic());
    }
}
